package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.FieldMeta;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 设备通道与光纤芯序号对照表 实体
 * </p>
 *
 * @author 黄露
 * @since 2020-08-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
// "DeviceFibreMatch对象", description = "设备通道与光纤芯序号对照表")
public class DeviceFibreMatch extends Model<DeviceFibreMatch> implements Cloneable {

    private static final long serialVersionUID = 1L;

    // "设备通道光纤id")
    @TableId(value = "device_fibre_id", type = IdType.AUTO)
    private Integer deviceFibreId;

    // "设备id")
    @FieldMeta(name = "设备id", description = "设备id")
    private Integer deviceId;

    // 路由id
    private Integer routeId;

    @FieldMeta(name = "设备sn", description = "设备sn")
    private String deviceSn;
    @FieldMeta(name = "设备名称", description = "设备名称")
    private String deviceName;
    @FieldMeta(name = "绑定设备sn", description = "绑定设备sn")
    private String targetDeviceSn;

    @FieldMeta(name = "绑定设备名称", description = "绑定设备名称")
    private String targetDeviceName;

    private Integer targetDeviceChannel;

    // "通道号（1-16）所有设备")
    @FieldMeta(name = "通道号", description = "通道号")
    private Integer channel;

    // "光纤id")
    @FieldMeta(name = "光纤id", description = "光纤id")
    private Integer fibreId;

    // "光纤名称")
    @FieldMeta(name = "光纤名称", description = "光纤名称")
    private String fibreName;

    // "光纤芯的序号")
    @FieldMeta(name = "光纤芯的序号", description = "光纤芯的序号")
    private Integer fibreCoreIndex;

    // "正常值")
    private String normalValue;

    // "报警值")
    private String alarmValue;

    private BigDecimal normalPadControl;

    // "光功率")
    private String lightPower;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    private String createBy;

    // "测量参数")
    private String measureArgs;

    @TableField(exist = false)
    private String monitorValue1;

    @TableField(exist = false)
    private String monitorValue2;

    @TableField(exist = false)
    private String alarmTypeName;

    @TableField(exist = false)
    private String alarmMsg;

    @TableField(exist = false)
    private boolean lengthAlarmFlag;

    @TableField(exist = false)
    private String deviceType;

    @TableField(exist = false)
    private String targetDeviceType;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastTime;

    @Override
    public Serializable pkVal() {
        return this.deviceFibreId;
    }

}
